widget: Notify a11y of focus changes
authorMatthias Clasen <mclasen@redhat.com>
Mon, 12 Oct 2020 17:13:00 +0000 (13:13 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 12 Oct 2020 19:10:40 +0000 (15:10 -0400)
This is using the new 'platform changes' mechanism
to tell the a11y backends when focus changes.

gtk/gtkwidget.c

index a0e2d5ed13b74206c0a5754f156c289cf509b049..fea2da5c3f037c8bdc0fdda6f38ce8f4181cf640 100644 (file)
@@ -4947,6 +4947,9 @@ gtk_widget_set_focusable (GtkWidget *widget,
   priv->focusable = focusable;
 
   gtk_widget_queue_resize (widget);
+
+  gtk_accessible_platform_changed (GTK_ACCESSIBLE (widget), GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSABLE);
+
   g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_FOCUSABLE]);
 }
 
@@ -9756,6 +9759,8 @@ gtk_widget_set_has_focus (GtkWidget *widget,
 
   priv->has_focus = has_focus;
 
+  gtk_accessible_platform_changed (GTK_ACCESSIBLE (widget), GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSED);
+
   g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_HAS_FOCUS]);
 }